import request from '@/utils/zyrequest'

export default {
    getList(page,size,name) {
        return request({
            url: '/item/role',
            method: 'get',
            params: {
                page: `${page}`,
                size: `${size}`,
                name: `${name}`
            }
        })
    },
    
    selectById(id) {
        return request({
            url: `/item/role/${id}`,
            method: 'get'
        })
    },

    save(pojo) {
        return request({
            url: '/item/role',
            method: 'post',
            data: JSON.stringify(pojo),
            headers: {
                'Content-Type': 'application/json;charset=UTF-8'
                // 'token': getToken()
            }
        })
    },

    update(pojo) {
        return request({
            url: '/item/role',
            method: 'put',
            data: JSON.stringify(pojo),
            headers: {
                'Content-Type': 'application/json;charset=UTF-8'
                // 'token': getToken()
            }
        })
    },

    delete(id) {
        return request({
            url: '/item/role',
            method: 'delete',
            params: {
                id: `${id}`
            }
        })
    },

    assignPerm(pojo) {
        return request({
            url: '/item/role/assignPerm',
            method: 'put',
            data: JSON.stringify(pojo),
            headers: {
                'Content-Type': 'application/json;charset=UTF-8'
            }
        })
    },

    findAll() {
        return request({
            url: '/item/allrole',
            method: 'get'
        })
    }

}